Add net8.0-maccatalyst TFM to Microsoft.Identity.Client#5863
Add net8.0-maccatalyst TFM to Microsoft.Identity.Client#5863mattleibow wants to merge 1 commit intoAzureAD:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds net8.0-maccatalyst support to MSAL.NET so Mac Catalyst apps consume the platform-specific build (reusing existing iOS UIKit implementation) and updates build/sample infrastructure accordingly.
Changes:
- Added
net8.0-maccatalystTFM wiring + compiler constants and iOS source inclusion for the new target. - Differentiated telemetry product name for Mac Catalyst.
- Updated MAUI dev apps/CI to build against .NET 8 and install/build Mac Catalyst workloads.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/devapps/MauiApps/MauiAppWithBroker/MauiAppWithBroker.csproj | Bumps MAUI app TFMs to net8.0 variants. |
| tests/devapps/MauiApps/MauiAppBasic/MauiAppBasic.csproj | Updates TFMs and iOS-specific IPA build conditions to net8.0. |
| tests/devapps/MauiApps/MauiAppB2C/MauiB2C.csproj | Bumps MAUI app TFMs to net8.0 variants. |
| src/client/Microsoft.Identity.Client/PublicApi/net8.0-maccatalyst/PublicAPI.Shipped.txt | Adds public API baseline for the new TFM. |
| src/client/Microsoft.Identity.Client/Platforms/iOS/iOSPlatformProxy.cs | Uses a distinct product name for Mac Catalyst telemetry. |
| src/client/Microsoft.Identity.Client/Microsoft.Identity.Client.csproj | Introduces net8.0-maccatalyst target + includes iOS platform sources for it. |
| build/template-build-on-mac.yaml | Adds Mac Catalyst workload install and builds for MSAL + Mac MAUI app. |
| build/platform_and_feature_flags.props | Adds MACCATALYST/iOS/MOBILE constants for the new TFM. |
src/client/Microsoft.Identity.Client/Microsoft.Identity.Client.csproj
Outdated
Show resolved
Hide resolved
65d1831 to
8c81002
Compare
Add Mac Catalyst target framework moniker (net8.0-maccatalyst) to the main MSAL.NET library. Mac Catalyst uses UIKit like iOS, so the existing iOS platform code (keychain, broker, webviews, HTTP client) is reused directly without duplication. Changes: - Add TargetFrameworkNetMacCatalyst property and include in multi-target builds - Define MACCATALYST and iOS compilation symbols for Mac Catalyst - Add SupportedOSPlatformVersion 14.0 for Mac Catalyst - Reuse Platforms/iOS source files for Mac Catalyst target - Add JSON build infrastructure DefineConstants (same as iOS) - Create PublicApi/net8.0-maccatalyst tracking files (copied from iOS) - Differentiate product name telemetry (MSAL.MacCatalyst vs MSAL.Xamarin.iOS) - Update CI mac build template with maccatalyst workload and build steps This enables Mac Catalyst apps to get full platform-specific MSAL functionality (keychain token caching, ASWebAuthenticationSession, broker support, NSUrlSessionHandler) instead of falling back to the generic netstandard2.0 build. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
8c81002 to
ff9662b
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a net8.0-maccatalyst target to Microsoft.Identity.Client so Mac Catalyst apps can consume the iOS platform implementation (Keychain cache, ASWebAuthenticationSession / WKWebView, broker hooks, etc.) instead of falling back to the netstandard2.0 build.
Changes:
- Adds
net8.0-maccatalystTFM toMicrosoft.Identity.Client.csproj, reusingPlatforms/iOS/**/*.csfor compilation. - Introduces
MACCATALYST+iOScompilation symbols (andMOBILE) for the Mac Catalyst TFM viaplatform_and_feature_flags.props. - Adds Mac Catalyst public API tracking files and updates iOS telemetry product name to distinguish Mac Catalyst vs iOS.
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/client/Microsoft.Identity.Client/Microsoft.Identity.Client.csproj | Adds Mac Catalyst TFM, sets SupportedOSPlatformVersion, reuses iOS sources for Mac Catalyst, wires PublicAPI files for the new TFM. |
| build/platform_and_feature_flags.props | Defines MACCATALYST;iOS;SUPPORTS_BROKER and MOBILE constants for the new TFM. |
| src/client/Microsoft.Identity.Client/Platforms/iOS/iOSPlatformProxy.cs | Adjusts telemetry product name when compiling for Mac Catalyst. |
| src/client/Microsoft.Identity.Client/PublicApi/net8.0-maccatalyst/PublicAPI.Shipped.txt | Adds the shipped public API baseline for the new net8.0-maccatalyst target. |
There was a problem hiding this comment.
Pull request overview
Adds a net8.0-maccatalyst target to the main Microsoft.Identity.Client library so Mac Catalyst apps consume the Apple-platform build (reusing the existing iOS platform implementation) instead of falling back to netstandard2.0.
Changes:
- Added
net8.0-maccatalystTFM toMicrosoft.Identity.Client.csproj, sharing iOS compile items and mobile OS platform constraints via combined MSBuild conditions. - Introduced Mac Catalyst compilation constants (
MACCATALYSTplusiOS) and included Mac Catalyst in theMOBILEconstant group. - Added Mac Catalyst PublicAPI baseline files and differentiated iOS vs Mac Catalyst telemetry product name.
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/client/Microsoft.Identity.Client/Microsoft.Identity.Client.csproj | Adds the Mac Catalyst TFM and reuses iOS sources/conditions for compilation and OS platform constraints. |
| build/platform_and_feature_flags.props | Defines MACCATALYST (and iOS) constants for the new TFM and includes it in MOBILE. |
| src/client/Microsoft.Identity.Client/Platforms/iOS/iOSPlatformProxy.cs | Adjusts product name telemetry to report MSAL.MacCatalyst when compiled for Mac Catalyst. |
| src/client/Microsoft.Identity.Client/PublicApi/net8.0-maccatalyst/PublicAPI.Shipped.txt | Introduces the Mac Catalyst public API baseline (matching the iOS surface). |
|
Hello! 👋 @bgavrilMS any chance you or someone from the team to have a look at this? |
Summary
Add Mac Catalyst target framework moniker (
net8.0-maccatalyst) to the main MSAL.NET library so Mac Catalyst apps get full platform-specific functionality instead of falling back to the genericnetstandard2.0build.Problem
The library currently targets
net8.0-iosbut notnet8.0-maccatalyst. This means Mac Catalyst apps (including MAUI apps) consume thenetstandard2.0build, missing:Approach
Mac Catalyst uses UIKit (not AppKit), so all existing iOS platform code (
Platforms/iOS/) is directly compatible. Rather than duplicating ~20 source files into a newPlatforms/MacCatalyst/directory, we reuse the iOS code by:net8.0-maccatalystas a new TFMMACCATALYSTandiOScompilation symbols so existing#if iOScode paths activatePlatforms/iOS/**/*.csfor the Mac Catalyst target (same as the iOS target)orconditions in PropertyGroups and ItemGroups to avoid duplicationChanges
Core Library (
Microsoft.Identity.Client.csproj)TargetFrameworkNetMacCatalystproperty (net8.0-maccatalyst)SupportedOSPlatformVersion14.0 for Mac Catalystorconditions (no duplication)TargetFrameworksfor Windows and OSX build platformsBuild Flags (
platform_and_feature_flags.props)MACCATALYST;iOS;SUPPORTS_BROKERconstants for Mac CatalystMOBILEgroup alongside Android and iOSPlatform Proxy (
iOSPlatformProxy.cs)MSAL.MacCatalystwhen on Mac Catalyst,MSAL.Xamarin.iOSon iOSPublic API (
PublicApi/net8.0-maccatalyst/)PublicAPI.Shipped.txt(copied from iOS — same API surface)PublicAPI.Unshipped.txtBuild Validation
Successfully built all TFMs on macOS with 0 warnings, 0 errors:
net8.0-maccatalyst✅net8.0-ios✅netstandard2.0✅net8.0✅